package cn.jr.service.impl;

import cn.jr.dao.IOrderProjectDao;
import cn.jr.dao.impl.OrderProjectDaoImpl;
import cn.jr.pojo.OrderProject;
import cn.jr.pojo.Wares;
import cn.jr.service.IOrderProjectService;

import java.util.ArrayList;

public class OrderProjectServiceImpl implements IOrderProjectService {
    IOrderProjectDao iopd = new OrderProjectDaoImpl();
    @Override
    public ArrayList<OrderProject> selectOrderProject() {
        return iopd.selectOrderProject(iopd.selectOrderProjectEnd().getOrderId());
    }

    @Override
    public ArrayList<OrderProject> queryOrderProject(String orderId) {
        return iopd.selectOrderProject(orderId);
    }

    @Override
    public OrderProject selectOrderProjectInOrderByWaresNumber(String orderId, String waresNumber) {
        return iopd.selectOrderProjectInOrderByWaresNumber(orderId, waresNumber);
    }

    @Override
    public int deleteOrderProjectByOrderProjectId(OrderProject orderProject) {
        return iopd.deleteOrderProjectByOrderProjectId(orderProject);
    }

    @Override
    public boolean insertOrderProject(Wares ware, Double waresCount) {
        return iopd.insertOrderProject(ware,waresCount)>0?true:false;
    }



    @Override
    public int updateOrderProjectInTuiHuo(Wares ware, Double waresCount, String orderId) {
        return iopd.updateOrderProjectInTuiHuo(ware,waresCount,orderId);
    }

    @Override
    public boolean insertOrderProjectInOrder(Wares ware, Double waresCount) {
        return iopd.insertOrderProjectInOrder(ware,waresCount)>0?true:false;
    }

    @Override
    public boolean deleteOrderProject(String waresNumber) {
        return iopd.deleteOrderProject(waresNumber)>0?true:false;
    }

    @Override
    public OrderProject selectOrderProjectEnd() {
        return iopd.selectOrderProjectEnd();
    }

    @Override
    public ArrayList<OrderProject> selectOrderProjectByWaresNumber(String waresNumber) {
        return iopd.selectOrderProjectByWaresNumber(waresNumber);
    }
}
